<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>map</title>
</head>
<body>
  <script>
  "use strict"
    // 字符串
    var mapStr  ="hello World";
    // 数组
    var mapArray = mapStr.split("");
    /*
    *map字符串的用法
    */
    // 1
		var map = Array.prototype.map;
    console.log(Array.prototype)
    var mapArr1 = map.call(mapStr,strToCode)
    
    // 2
    var mapArr2 = [].map.call(mapStr,strToCode)

    //3:map数组的用法
   var mapArr3 = mapArray.map(strToCode)

   console.log(mapArr3)

   // 字符串转换成ascill码
   function strToCode(item){
      return item.charCodeAt(0)
   }
	</script>
</body>
</html>